<table class="table">
    <thead>
        <tr>
            <th><span class="label" style="color: #000;font-weight: 500;font-size: 85%;padding: .2em 0 .3em;">账号</span></th>
            <th>订单号</th>
            <th>平台SKU</th>
            <th>FNSKU</th>
            <th>仓库</th>
            <th>站点</th>
            <th>国家</th>
            <th>SKU</th>
            <th><span class="label" style="color: #000;font-weight: 500;font-size: 85%;padding: .2em 0 .3em;">安排数量</span></th>
            <th><span class="label" style="color: #000;font-weight: 500;font-size: 85%;padding: .2em 0 .3em;">发货数量</span></th>
            <th>Carrier</th>
            <th>追踪号</th>
            <th>发货日期</th>
        </tr>
    </thead>
    <tbody>
    <tr bgcolor='#fff0f5'>
        @foreach($headers as $col)
            @if($col == 'order_id')
                <td>TTL</td>
            @else
                <td>{{ array_key_exists($col,$total) ? (is_null($total[$col])  ? 0 : $total[$col]) : '' }}</td>
            @endif
        @endforeach
    </tr>
        @foreach($paginator as $row)
            <tr>
                <td style="border-top-color:#00a7d0;"><span class="label" style="color: #000;font-weight: 500;font-size: 85%;padding: .2em 0 .3em;">{{ \App\Models\Basics\SysPlatAccount::getAccountById($row->account_id) }}</span></td>
                <td style="border-top-color:#00a7d0;">{{ $row->order_id }}</td>
                <td style="border-top-color:#00a7d0;"><span class="label" style="color: #000;font-weight: 500;font-size: 85%;padding: .2em 0 .3em;">{{ $row->seller_sku  }}</span></td>
                <td style="border-top-color:#00a7d0;">{{ $row->fnsku }}</td>
                <td style="border-top-color:#00a7d0;">{{ $row->warehouse->w_code ?? '' }}</td>
                <td style="border-top-color:#00a7d0;">{{ $row->area->area ?? '' }}</td>
                <td style="border-top-color:#00a7d0;">{{ $row->country->country ?? '' }}</td>
                <td style="border-top-color:#00a7d0;">{{ $row->sku->psku_code ?? '' }}</td>
                <td style="border-top-color:#00a7d0;">{{ $row->plan_num }}</td>
                <td style="border-top-color:#00a7d0;">{{ $row->ship_num }}</td>
                <td style="border-top-color:#00a7d0;"></td>
                <td style="border-top-color:#00a7d0;"></td>
                <td style="border-top-color:#00a7d0;"></td>
            </tr>
            @foreach($row->detail as $detail)
                <tr>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td>{{ $detail->ship_num }}</td>
                    <td><a href="javascript:void(0)"
                           data-container="body"
                           data-toggle="popover"
                           data-placement="top"
                           data-html="true"
                           data-trigger="hover"
                           data-content="{{ $detail->carrier }}">{{ \Illuminate\Support\Str::limit($detail->carrier,10) }}</a>
                    </td>
                    <td><span class="label" style="color: #000;font-weight: 500;font-size: 85%;padding: .2em 0 .3em;">
                            <a href="javascript:void(0)"
                               data-container="body"
                               data-toggle="popover"
                               data-placement="top"
                               data-html="true"
                               data-trigger="hover"
                               data-content="{{ $detail->tracking_number }}">{{ \Illuminate\Support\Str::limit($detail->tracking_number,15) }}</a>
                        </span>
                    </td>
                    <td><span class="label" style="color: #000;font-weight: 500;font-size: 85%;padding: .2em 0 .3em;">{{ $detail->shipment_date }}</span></td>
                </tr>
            @endforeach
        @endforeach
    </tbody>
</table>
<script language="JavaScript" type="text/javascript">
    $(function () {
        $('[data-toggle="popover"]').popover();
    });
</script>
